<html>
<head>
<script src="${ctxPath}/resource/js/jquery-2.1.3.min.js"></script>
<script src="${ctxPath}/resource/js/time.js"></script>
<script>
$(document).ready(function(){
	  $(document).on('click','.page',function(){
	  	var action = $(this).html();
	  	var current = parseInt($("#current").html());
	  	var page = current;
	  	if(action=="next"){
	  		page++;
	  	}else{
	  		page--;
	  	}
	  	//加载html,table-container的内容将从后台加载
	  	startTime();
	  	$("#table-container").load("beetlajax.html?ajaxCmd=userTable",{"page":page},function(){
	  		endTime();	  		
	  		
	  	});
	  	
	  	
	  });
	});

</script>
</head>
<body>
这是一个beetl-ajax测试页面,加载时间是: ${date(),'yyyy-MM-dd:hh:mm:ss'}
<p>
<div id="table-container" >
<%
#ajax userTable: {
%>

<table>
	<tr><td width=100>id</td><td width=100>姓名</td></tr>
	<%for(user in users){%>
	<tr><td>${user.id}</td><td>${user.name}</td></tr>
	<%}%>
</table>

当前页面<span id="current">${page!1}</span><span style="width:20px"></span> 
<a href="#"><span  class="page">next</span></a> <a href="#" ><span  class="page">pre</span></a> 
<%
}
%>
</div>
耗时<span id="time" ></span>
</body>
</html>
